/**
 * 常用方法封装 请求，文件上传等
 * @author echo. 
 **/

import tui from './httpRequest'
const profile = {
    LoadUserInfo: async function() {
        await tui.request('/profile/user_info').then(res => {
            console.log(res)
            if (res.code == 200) {
                uni.setStorageSync('userinfo', res.data);
            } else {
                this.tui.toast(res.message)
            }
        }).catch(e => {
            this.tui.toast('网络异常')
        })
    },
    GetUserInfo: function() {
        return uni.getStorageSync('userinfo');
    }
}
export default profile
